﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SSharp.Core.DataTypes;
using System.Numerics;

namespace SSharp.Core.Evaluator {
	public static partial class Eval {
		/// <summary>
		/// Evaluates simple expressions
		/// </summary>
		private class SimpleExpressionEvaluator : Evaluator {
			public bool CanEvaluate(object expression) {
				return expression is BigInteger
				|| expression is decimal
				|| expression is string
				// the following types can't be read directly but can be returned from macros
				|| expression is PrimitiveProcedure
				|| expression is Macro;
			}

			public EvaluationResult Evaluate(object expression, IEnvironment env) {
				return new EvaluationResult(expression);
			}
		}
	}
}
